package moodle.dados.atividades;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.*;


@Entity
@Table(name = "mdl_forum")
@NamedQuery(name="Forum.findByCourse", query="SELECT f FROM Forum f WHERE course = ?1")
public class Forum extends AtividadeParticipacao {
	
	@Transient
	private boolean avaliativo;
	private BigDecimal scale;
	private int assessed;
	private Long assesstimestart;
	private Long assesstimefinish;
	
	public Forum(){}
	
	public BigDecimal getScale() {
		return scale;
	}
	
	public boolean isAvaliativo() {
		return assessed == 0 ? false : true;
	}
	
	public Date getAssesstimestart() {
		return new Date(assesstimestart*miliSec);
	}

	public Date getAssesstimefinish() {
		return new Date(assesstimefinish*miliSec);
	}
	
	public Date getDataInicio(){
		return getAssesstimestart();
	}
	
	public Date getDataFinal(){
		return getAssesstimefinish();
	}
	
	public BigDecimal getNotaMaxima(){
		return scale;
	}
	
}